package com.mihoyo.controller;

import com.mihoyo.domain.Product;
import com.mihoyo.service.ProductService;
import com.mihoyo.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private ProductService productService;

    @RequestMapping("/add")
    public AjaxResult add (@RequestBody Product product) {
        AjaxResult ajaxResult = productService.add(product);
        return ajaxResult;
    }
}
